package com.broadengate.service;

import java.util.List;

import com.broadengate.dao.BaseDao;
import com.broadengate.util.ServiceException;
import com.broadengate.view.model.BaseModel;

public abstract class BaseService<T>
{
    public abstract BaseDao<T> getDao();
    
    public List<T> queryByList(BaseModel model) throws ServiceException
    {
        
        model.setRowCount(getDao().queryByCount(model));
        return getDao().queryByList(model);
    }
    
    public int queryByCount(BaseModel model) throws ServiceException
    {
        return getDao().queryByCount(model);
    }
}
